]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
theme-node-transition: Receive a CoglFramebuffer
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 6 Oct 2018 01:28:10 +0000 (22:28 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 28 Jan 2019 14:35:41 +0000 (12:35 -0200)
This is in preparation for a future where only explicit frambuffer
APIs are available, i.e., cogl_get_draw_framebuffer() does not
exist.

There is absolutely no functional changes in this patch (nor the
following ones in this series), only rearrangements so that various
functions receive a CoglFramebuffer instead of using the draw
framebuffer.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/283

src/st/st-theme-node-transition.c
src/st/st-theme-node-transition.h
src/st/st-widget.c

index 62f0ef517f70538beac09f4c7a2bfa5568a096a4..294c7e664c69c85c303c8b1d268aa2beb336f421 100644 (file)
@@ -337,11 +337,11 @@ setup_framebuffers (StThemeNodeTransition *transition,
 
 void
 st_theme_node_transition_paint (StThemeNodeTransition *transition,
+                                CoglFramebuffer       *framebuffer,
                                 ClutterActorBox       *allocation,
                                 guint8                 paint_opacity)
 {
   StThemeNodeTransitionPrivate *priv = transition->priv;
-  CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
 
   CoglColor constant;
   float tex_coords[] = {
@@ -374,7 +374,8 @@ st_theme_node_transition_paint (StThemeNodeTransition *transition,
                               paint_opacity, paint_opacity,
                               paint_opacity, paint_opacity);
 
-  cogl_framebuffer_draw_multitextured_rectangle (fb, priv->material,
+  cogl_framebuffer_draw_multitextured_rectangle (framebuffer,
+                                                 priv->material,
                                                  priv->offscreen_box.x1,
                                                  priv->offscreen_box.y1,
                                                  priv->offscreen_box.x2,
index 8762b6d31b21c2680ab24ee73554174f4e9a14e6..6f45ab83480646cbcfea03bc0e8a42f2fb855b35 100644 (file)
@@ -41,6 +41,7 @@ void  st_theme_node_transition_update   (StThemeNodeTransition *transition,
                                          StThemeNode           *new_node);
 
 void  st_theme_node_transition_paint    (StThemeNodeTransition *transition,
+                                         CoglFramebuffer       *framebuffer,
                                          ClutterActorBox       *allocation,
                                          guint8                 paint_opacity);
 
index 7c39b358552bcecd31070d71ca4b5b287fa7cddf..38a078c0254ced65731201c23376876e5c13554f 100644 (file)
@@ -414,10 +414,12 @@ void
 st_widget_paint_background (StWidget *widget)
 {
   StWidgetPrivate *priv = st_widget_get_instance_private (widget);
+  CoglFramebuffer *framebuffer;
   StThemeNode *theme_node;
   ClutterActorBox allocation;
   guint8 opacity;
 
+  framebuffer = cogl_get_draw_framebuffer ();
   theme_node = st_widget_get_theme_node (widget);
 
   clutter_actor_get_allocation_box (CLUTTER_ACTOR (widget), &allocation);
@@ -426,12 +428,13 @@ st_widget_paint_background (StWidget *widget)
 
   if (priv->transition_animation)
     st_theme_node_transition_paint (priv->transition_animation,
+                                    framebuffer,
                                     &allocation,
                                     opacity);
   else
     st_theme_node_paint (theme_node,
                          current_paint_state (widget),
-                         cogl_get_draw_framebuffer (),
+                         framebuffer,
                          &allocation,
                          opacity);
 }